package cn.com.huzo.model.entities.inventory;

import com.fasterxml.jackson.annotation.JsonFormat;
import huzofw.model.entities.BaseEntity;
import huzofw.model.entities.IAggregateRoot;
import java.io.Serializable;
import java.sql.Timestamp;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 原辅料出库主表实体类
 *
 * @author 吴旭
 */
public class StockOutHeaderEntity extends BaseEntity implements Serializable, IAggregateRoot {

    private static final long serialVersionUID = -4986565811675219871L;
    private Long HeaderId;                      // 标识，自动增加
    private String BillNo;                      // 单据号（自动生成 RKD_201605_0001）   
    private Timestamp DateOfStockOut;           // 出库日期
    private Integer ReasonId;                   // 库存操作原因码
    private Long RsHeaderId;                    // 领料单ID
    private String StyleNo;                     // 款号（由明细中款号组成301/302)
    private String MaterialRequisitionUnitName; // 领料部门
    private Long RequisitedBy;                  // 领料员
    private String RequisitedByName;
    private Boolean BalanceFlag;                // 结存标记(0：未结存 1：结存)
    private String Description;

    public Long getHeaderId() {
        return HeaderId;
    }

    public void setHeaderId(Long HeaderId) {
        this.HeaderId = HeaderId;
    }

    public String getBillNo() {
        return BillNo;
    }

    public void setBillNo(String BillNo) {
        this.BillNo = BillNo;
    }

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    public Timestamp getDateOfStockOut() {
        return DateOfStockOut;
    }

    public void setDateOfStockOut(Timestamp DateOfStockOut) {
        this.DateOfStockOut = DateOfStockOut;
    }

    public Integer getReasonId() {
        return ReasonId;
    }

    public void setReasonId(Integer ReasonId) {
        this.ReasonId = ReasonId;
    }

    public Long getRsHeaderId() {
        return RsHeaderId;
    }

    public void setRsHeaderId(Long RsHeaderId) {
        this.RsHeaderId = RsHeaderId;
    }

    public String getStyleNo() {
        return StyleNo;
    }

    public void setStyleNo(String StyleNo) {
        this.StyleNo = StyleNo;
    }

    public String getMaterialRequisitionUnitName() {
        return MaterialRequisitionUnitName;
    }

    public void setMaterialRequisitionUnitName(String MaterialRequisitionUnitName) {
        this.MaterialRequisitionUnitName = MaterialRequisitionUnitName;
    }

    public Long getRequisitedBy() {
        return RequisitedBy;
    }

    public void setRequisitedBy(Long RequisitedBy) {
        this.RequisitedBy = RequisitedBy;
    }

    public String getRequisitedByName() {
        return RequisitedByName;
    }

    public void setRequisitedByName(String RequisitedByName) {
        this.RequisitedByName = RequisitedByName;
    }

    public Boolean getBalanceFlag() {
        return BalanceFlag;
    }

    public void setBalanceFlag(Boolean BalanceFlag) {
        this.BalanceFlag = BalanceFlag;
    }

    public String getDescription() {
        return Description;
    }

    public void setDescription(String Description) {
        this.Description = Description;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof StockOutHeaderEntity)) {
            return false;
        }

        final StockOutHeaderEntity that = (StockOutHeaderEntity) o;

        return new EqualsBuilder()
                .append(this.getHeaderId(), that.getHeaderId())
                .isEquals();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public int hashCode() {
        int result = 17;
        result = 31 * result + getHeaderId().hashCode();

        return result;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this);
    }
}
